# print('a'=='b',end='bb')
# # ...作用
# message= '''
# [sa]
# sd
# fd
# g  a
# '''
# print(message)
#
# print(message)
#
# '''
# 三引号可用作多行注释  前提是不给他赋值
# '''
# print('=========================')
#
# person = 'aa'
# # %s str 字符串
# print('%s '% (person))
# #print('asa'+5) 报错字符串不能和数字相加
# print('aaa'+str(12))
#
# print('======================')
# # %d digit 数字
# print('aa%d' % (54))
#
# print('======================')
#
# # %f
# print('sss%f' % 8886.11)
# print('sss%.2f' % 8886.11)#保留2为小数
#
# #format是一个字符串中的函数''.format()
# age = 2
# message = '我今年{}岁了,在{}上学,有{}零花钱'.format(age,'学校',3.16)
# print(message)
#
#
# print('======================')
# xsg = input('输入一个小傻瓜')
#
# print('这个小傻瓜是'+xsg)
#
# print('======================')
#
# name = input()
# print(name)

# print('======================')
#
# name = 'admin'
# name1 = 'admin'
#
# print(id(name),name)
# print(id(name1),name1)#identity 特征，身份
#
# a = 'aa'=='aa' or 'aa'=='bb'
# print(a)
#
# if a != True:
#     print(a)
# else:
#     print(False)

# a = 23
# print(bin(a)) #0b 表示2进制
# a = -23
# print(bin(a))
#
# b = 1101
# print(int(b))

# 三目运算
# res = 'z'  if  (8>10) else 'j'
# print(res)

# if
# a=1
# if a:# python 判断的变量是‘’ 0 Node 默认是False
#     # 如果变量有值 认为是True
#     print('aaa')
# else:
#     print('bbb')
#
# print('aaa')

import random

# a = random.randint(1,100)
# print(a)
# if 1<=a<60 :
#     print('不及格')
# elif 60<=a <80 :
#     print('及格')
# else:
#     print('优秀')

# range(开始，结束，每次跳过多少)
# while True:
#     a = random.randint(1,100)
#     for i in range(5):
#         print('猜猜这个数')
#         print('偷偷告诉你这个数是',a)
#         b = int(input('你有5次机会这是第{}次'.format(i+1)))
#         if b==a:
#             print('恭喜你猜对了！')
#             print('接着菜第{}个数吧'.format(ii))
#             a = random.randint(1,100)
#             break
#         elif b>a:
#             print('你菜的数大了')
#             if i == 4:
#                 print('5次都没对 你真菜')
#                 ii=0
#                 pass
#         else :
#             print('你猜的小了')
#             if i == 4:
#                 print('5次都没对 你真菜')
#                 ii=0
#                 pass

# i = 0
# while i<10 :
#     print(i)
#     i+=1

# name = 'ni shi wo de mei'
# a = 'ni' in name
# print(a)
#
# print(r'%s说\'')

# b = name.split( ' ')
# print(b)
# print(name[0:16]) #从下表0开始取16个数 前后都可以省略
# print(name[::-1]) #-1表示倒叙
# print(name[0:15:-1])


# 字符串内建函数 默认可以调用
# 大小写相关
#  upper(): 所有字母都大写 lower() 所有字母都小写
# message = 'xiaoqing is a beautiful girl AAAA'
# msg1 = message.lower()
# msg2 = message.upper()
# print(msg1)
# print(msg2)
# # len()内置函数 求字符串长度
# print(len(message))
# print(message.replace(' ','#'))

# msg = '哈哈哈'
# msgc = msg.encode()
# print(msgc)
# print(msgc.decode())

# filename = 'aaa.txt'
# r = filename.endswith('.txt')#以什么结尾
# r = filename.startswith('.txt')#以什么开头
# print(r)

# s = '333'
# r = s.isalpha() #是否都是字母
# print(r)
# r = s.isdigit() #是否都是数字
# print(r)
# r = ' '.join('sabchg') #将sabhg用空格连接构成一个新字符串
# print(r)
# r = ' '+r+' '
# print(r)
# r = r.lstrip() #去除字符串左侧空格
# r = r.rstrip() #去除字符串左侧空格
# r = r.strip() #去除字符串两侧空格
# r = r.split(' ',2) #分割字符串 2意思是分割2次
# print(r)

# print('===================================')
#
# names = ['s','d','ss','fs']
# a= 0
# for i in names :
#     print(i)
#     if 'n' in i :
#         print('s出现在了'+i+'中')
#         a+=1
# if a == 0:
#     print('s 没有出现')
# print(names)

# 列表支持切片
# names = ['aaa','bbb','ccc','ddd',213,567,890]
# print(names[2:5])
# print(names[::-1])

# 列表添加
# names = []
# name = input('输入一个名字')
# names.append(name)# 末尾追加
# names.insert(0,'xan')# 指定位置添加
# print(names)

# 列表排序
# names = [4,234,5436,5,7898,989,]
# snames = sorted(names) #升序
# print(snames)
# snames = sorted(names , reverse=True)# 降序
# print(snames)


# 元组 类似列表
# t1 = (1,2,3,4,5)
# t2 = [1,2,34]
# print(max(t1))#最大值
# print(min(t1))#最小值
# print(sum(t2))#和
# print(t1.count(1))#t1中1出现的次数
# del t1[0] #错误语法 （）无法增删改
# print(t1)

# a,b,*c = t2
# print(a,b,c)

#
# user = {'name': '貂蝉', 'zhuangbei': ['屠龙刀', '手榴弹'], 'jifen': 800}
# print(user.get('name'))
# user['jiazhi'] = '13266'  # 增加和修改 无增 有改
# user['jifen'] = 5462  # 增加和修改 无增 有改
# print(user)

#
# def add(a=10):
#     for i in range(a):
#         ran = random.randint(1,20)
#         print(ran)
# add(5)

# def add(a=10,b=10,c=10):
#     for i in range(c):
#         ran = random.randint(1,20)
#         print(ran)
# add(c=5)

# student = {'name':'vv','age':10}
# students = [student,student]
# print(students)
# def add(a,*b,**c): #a必传 b元组 c map
#     print(a,b,c)
#     return '返回了'
# print(add(1))

# s = 'a'
# def student():
#     ss = 'aaa'
#     ss += s
#     def gitStudent():
#         return {'student':{'ss':ss}}
#
#
# print(s)
